package book.book.dao;

import book.book.bean.User;
import book.book.util.Base;

import java.util.List;

public class UserDaoImpl extends Base implements UserDao{
    @Override
    public User login(User user) {
        String sql = "select * from tb_user where username = ? and password = ?";
        return getOne(User.class, sql, user.getUsername(), user.getPassword());

    }

    @Override
    public List<User> getAllUsers() {
        String sql = "select * from tb_user";
        return getAll(User.class, sql);
    }
}
